import { request } from "@/utils/request.js"

// 获取用户可用权益分
export function getUserUsableIntegral() {
	return request({
		url: "/ht-nonrealtime-gameservice/integral/getUserUsableIntegral",
		method: "POST",
	});
}


// 获取权益分一级分类下拉框
export function getlistParentType() {
	return request({
		url: "/ht-nonrealtime-gameservice/tbScoreType/listParentType",
		method: "GET",
	});
}
// 权益分二级分类下拉框
export function getListType(data) {
	return request({
		url: '/ht-nonrealtime-gameservice/tbScoreType/listType',
		method: 'GET',
		data: data
	})
}

// 商品根据分类分页查询
export function goodsPage(data) {
	return request({
		url: "/ht-nonrealtime-gameservice/tbScoreType/goodsPage",
		method: "GET",
		data: data
	});
}
// 商品根据id查询商品详细信息
export function getGoods(data) {
	return request({
		url: "/ht-nonrealtime-gameservice/tbScoreGoods/getGoods",
		method: "GET",
		data: data
	})
}
// 首页商品图片展示,最大5条
export function firstPagePic() {
	return request({
		url: "/ht-nonrealtime-gameservice/tbScoreGoods/firstPagePic",
		method: "GET"
	})
}
// 首页商品热销商品分页
export function getPageHotGoods(data) {
	return request({
		url: "/ht-nonrealtime-gameservice/tbScoreGoods/firstPageHotGoods",
		method: "GET",
		data: data
	})
}
// 热销商品根据分类分页查询
export function getHotByPage(data) {
	return request({
		url: "/tbScoreHot/hotByPage",
		method: "POST",
		data: data
	})
}

// 商品根据商品名模糊分页查询
export function getGoodName(data) {
	return request({
		url: "/ht-nonrealtime-gameservice/tbScoreGoods/pageByLike",
		method: "GET",
		data: data
	})
}
// 提交普通商品订单
export function addOrder(id, orderNum) {
	return request({
		url: `/ht-nonrealtime-gameservice/tbScoreOrder/addOrder?id=${id}&orderNum=${orderNum}`,
		method: "POST",
	})
}
// 商品收藏
export function collectGoods(data) {
	return request({
		url: "/ht-nonrealtime-gameservice/tbScoreGoods/collectGoods",
		method: "GET",
		data: data
	})
}
// 商品取消收藏
export function deleteGoods(data) {
	return request({
		url: "/ht-nonrealtime-gameservice/tbScoreGoods/deleteGoods",
		method: "GET",
		data: data
	})
}
// 限时福利列表
export function limitedhotByPage(data) {
	return request({
		url: "/ht-nonrealtime-gameservice/tbScoreHot/hotByPage",
		method: "POST",
		data: data
	})
}
// 限时福利详情
export function getHotGoods(data) {
	return request({
		url: `/ht-nonrealtime-gameservice/tbScoreHot/getHotGoods?id=${data}`,
		method: "POST"
	})
}
// 限时福利取消收藏
export function deleteHotGoods(data) {
	return request({
		url: "/ht-nonrealtime-gameservice/tbScoreHot/deleteHotGoods",
		method: "GET",
		data: data
	})
}
// 限时福利收藏
export function collectHotGoods(data) {
	return request({
		url: "/ht-nonrealtime-gameservice/tbScoreHot/collectHotGoods",
		method: "GET",
		data: data
	})
}

// 限时福利兑换
export function addHotOrder(id,orderNum) {
	return request({
		url: `/ht-nonrealtime-gameservice/tbScoreOrder/addHotOrder?hotId=${id}&orderNum=${orderNum}`,
		method: "POST"
	})
}
// 商城限时福利搜索历史
export function listHotHistory() {
	return request({
		url: `/ht-nonrealtime-gameservice/tbScoreHot/listHotHistory`,
		method: "GET"
	})
}
// 订单详情
export function getOrderById(id) {
	return request({
		url: `/ht-nonrealtime-gameservice/tbScoreOrder/getOrderById?id=${id}`,
		method: "GET"
	})
}
// 热搜商品
export function listPubHistory() {
	return request({
		url: `/ht-nonrealtime-gameservice/tbScoreType/listPubHistory`,
		method: "GET"
	})
}

export  const get1688NavParamsApi = () => {
	return	request({
		url: '/ht-nonrealtime-gameservice/thirdPartyApi/getTokenByPhone',
		method: "POST"
	})
}
